<?php

namespace app\admin\model\wdsxh;

use think\Model;


class Config extends Model
{

    

    

    // 表名
    protected $name = 'wdsxh_config';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'home_mode_text',
        'navtext_text',
        'member_unit_show_text',
        'member_show_text',
        'news_show_text',
        'business_show_text',
        'business_foreign_text',
        'business_audit_text'
    ];
    

    
    public function getHomeModeList()
    {
        return ['1' => __('Home_mode 1'), '2' => __('Home_mode 2')];
    }

    public function getNavtextList()
    {
        return ['商会' => __('Navtext 商会'), '协会' => __('Navtext 协会'), '校友会' => __('Navtext 校友会'), '工会' => __('Navtext 工会'), '学会' => __('Navtext 学会'), '学生会' => __('Navtext 学生会'), '联合会' => __('Navtext 联合会'), '分会' => __('Navtext 分会'), '社团' => __('Navtext 社团'), '基金会' => __('Navtext 基金会'), '总会' => __('Navtext 总会'), '研究会' => __('Navtext 研究会')];
    }

    public function getMemberUnitShowList()
    {
        return ['1' => __('Member_unit_show 1'), '0' => __('Member_unit_show 0')];
    }

    public function getMemberShowList()
    {
        return ['1' => __('Member_show 1'), '0' => __('Member_show 0')];
    }

    public function getMemberDetailShowList()
    {
        return ['1' => __('Member_detail_show 1'), '0' => __('Member_detail_show 0')];
    }

    public function getNewsShowList()
    {
        return ['1' => __('News_show 1'), '0' => __('News_show 0')];
    }

    public function getBusinessShowList()
    {
        return ['1' => __('Business_show 1'), '0' => __('Business_show 0')];
    }

    public function getBusinessForeignList()
    {
        return ['1' => __('Business_foreign 1'), '0' => __('Business_foreign 0')];
    }

    public function getBusinessAuditList()
    {
        return ['1' => __('Business_audit 1'), '0' => __('Business_audit 0')];
    }


    public function getHomeModeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['home_mode']) ? $data['home_mode'] : '');
        $list = $this->getHomeModeList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getNavtextTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['navtext']) ? $data['navtext'] : '');
        $list = $this->getNavtextList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getMemberUnitShowTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['member_unit_show']) ? $data['member_unit_show'] : '');
        $list = $this->getMemberUnitShowList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getMemberShowTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['member_show']) ? $data['member_show'] : '');
        $list = $this->getMemberShowList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getNewsShowTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['news_show']) ? $data['news_show'] : '');
        $list = $this->getNewsShowList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getBusinessShowTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['business_show']) ? $data['business_show'] : '');
        $list = $this->getBusinessShowList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getBusinessForeignTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['business_foreign']) ? $data['business_foreign'] : '');
        $list = $this->getBusinessForeignList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getBusinessAuditTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['business_audit']) ? $data['business_audit'] : '');
        $list = $this->getBusinessAuditList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
